package com.efast.cafe.portal.dao.company;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.efast.cafe.framework.mybatis.CafeMapper;
import com.efast.cafe.portal.bean.company.PortalCompanyRoleQueryBean;
import com.efast.cafe.portal.entity.company.PortalCompanyRole;

public interface PortalCompanyRoleDao extends CafeMapper<PortalCompanyRole>{

	/**
	 * @Date : 2016-8-25
	 * @param positionId
	 * @return
	 */
	List<PortalCompanyRole> getroleHasSelectList(@Param(value = "positionId") Long positionId,
			@Param(value = "companyCode") String companyCode);

	/**
	 * @Date : 2016-8-25
	 * @param roleHasSelectList
	 * @return
	 */
	List<PortalCompanyRole> getroleNotHasSelectList(
			@Param(value = "roleHasSelectList") List<PortalCompanyRole> roleHasSelectList,
			@Param(value = "companyCode") String companyCode);

	/**
	 * 通过角色名查看id
	 * 
	 * @param rolename
	 * @param companyCode
	 * @return
	 */
	Integer getroleIdbyroleName(@Param(value = "rolename") String rolename,
			@Param(value = "companyCode") String companyCode);

	List<PortalCompanyRole> getroleNamebyDefault(@Param(value = "companyCode") String companyCode);

	/**
	 * 查询企业角色
	 * 
	 * @param companyCode
	 * @param rolename
	 * @return
	 */

	List<PortalCompanyRole> queryRoleList(PortalCompanyRoleQueryBean bean);

	Integer queryRoleCount(PortalCompanyRoleQueryBean bean);

	/**
	 * 查询公司下的所有角色
	 * 
	 */
	public List<PortalCompanyRole> queryRoleAll(@Param(value = "roleName") String roleName,@Param(value = "companyCode") String companyCode);

	public List<PortalCompanyRole> queryRoleByUser(@Param(value = "username") String username,@Param(value = "companyCode") String companyCode);
}
